package com.intellagric.controller.module.loganalyse;

import com.intellagric.common.pojo.LayuiDataGridResult;
import com.intellagric.service.module.loganalyse.LogAnalyzeJobMinuteAppendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * @Auther: zhy
 * @Date: 2019/5/11
 * @Description: 日志分析每分钟增量数据管理
 */
@Controller
public class LogAnalyzeJobMinuteAppendController {

    @Autowired
    private LogAnalyzeJobMinuteAppendService logAnalyzeJobMinuteAppendService;

    /**
     * 根据indexName查询日志分析每分钟增量数据信息
     * @return LogAnalyzeJobMinuteAppend
     */
    @RequestMapping("/log/analysejob/append/minute/list")
    @ResponseBody
    public LayuiDataGridResult get(String indexName,
                                   @DateTimeFormat(pattern = "yyyy-MM-dd")
                                   Date startTime,
                                   @DateTimeFormat(pattern = "yyyy-MM-dd")
                                   Date endTime) {
        return logAnalyzeJobMinuteAppendService.queryLogAnalyzeJobMinuteAppendById(indexName,startTime,endTime);
    }


}
